package psn.kiko.service.database.ddl.table.truncate;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import psn.kiko.mapper.ddl.table.truncate.TruncateMapper;

/**
 * 截断表
 */
@Service
@Slf4j
public class TruncateService {
	private TruncateMapper truncateMapper;
	
	@Autowired
	public void setTruncateMapper(TruncateMapper truncateMapper) {
		this.truncateMapper = truncateMapper;
	}
	
	/**
	 * 截断指定表
	 * @param table 表名
	 */
	public void truncate(String table){
		log.debug("准备截断表：{}",table);
		truncateMapper.truncate(table);
		log.debug("成功截断表：{}",table);
	}
}
